package com.hm.ipay.controller;

import com.hm.ipay.comm.aop.LoggerManage;
import com.hm.ipay.domain.result.ResponseData;
import com.hm.ipay.entity.AdminUser;
import com.hm.ipay.entity.GlobalConfig;
import com.hm.ipay.entity.UserReturnVisit;
import com.hm.ipay.service.AdminService;
import com.hm.ipay.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AdminController {
    @Autowired
    AdminService adminService;

    @RequestMapping(value = "/bg/admin_user_list", method = RequestMethod.POST)
    @LoggerManage(description = "后台账户列表")
    public ResponseData adminUserList() {
        return adminService.adminUserList();
    }

    @RequestMapping(value = "/bg/system_config", method = RequestMethod.POST)
    @LoggerManage(description = "获取系统配置")
    public ResponseData getSystemConfig() {
        return adminService.getSystemConfig();
    }

    @RequestMapping(value = "/bg/update_system_config", method = RequestMethod.POST)
    @LoggerManage(description = "获取系统配置")
    public ResponseData updateSystemConfig(GlobalConfig config) {
        return adminService.updateSystemConfig(config);
    }

    @RequestMapping(value = "/bg/admin_login", method = RequestMethod.POST)
    @LoggerManage(description = "后台用户登录")
    public ResponseData adminUserLogin(AdminUser adminUser, String validate) {
        return adminService.adminUserLogin(adminUser, validate);
    }

    @RequestMapping(value = "/bg/admin_delete", method = RequestMethod.POST)
    @LoggerManage(description = "删除后台用户")
    public ResponseData adminUserDelete(AdminUser adminUser) {
        return adminService.adminUserDelete(adminUser);
    }

    @RequestMapping(value = "/bg/admin_add", method = RequestMethod.POST)
    @LoggerManage(description = "添加后台用户")
    public ResponseData adminUserAdd(AdminUser adminUser) {
        return adminService.adminUserAdd(adminUser);
    }

    @RequestMapping(value = "/bg/admin_update", method = RequestMethod.POST)
    @LoggerManage(description = "编辑后台用户")
    public ResponseData adminUserUpdate(AdminUser adminUser) {
        return adminService.adminUserUpdate(adminUser);
    }

    @RequestMapping(value = "/bg/get_admin", method = RequestMethod.POST)
    @LoggerManage(description = "获取后台用户")
    public ResponseData getAdminUser(Long id) {
        return adminService.getAdminUser(id);
    }

    @RequestMapping(value = "/add_user_return_visit", method = RequestMethod.POST)
    @LoggerManage(description = "添加待回访记录")
    public ResponseData addUserReturnVisit(UserReturnVisit returnVisit) {
        return adminService.addUserReturnVisit(returnVisit);
    }
}
